<?php
session_start();
if (isset($_POST['rate']) && $_POST['rate'] == 'recapcha')
    echo '<img onclick="recapcha(); return false;" src="core/libs/index.php?' . session_name() . '=' . session_id() . '" />';

if (isset($_POST['nick']) && isset($_POST['getGender'])) :
    require_once "core/application/controllers/cchangegender.php";
    $gender = changeGender_Controller::getInstance()->getGenderFromModel($_POST['nick']);
    if ($gender == 'MALE') :
        ?>
        <option value="MALE" selected>Мужской</option>
        <option value="FEMALE">Женский</option>
    <?php else : ?>
        <option value="MALE">Мужской</option>
        <option value="FEMALE" selected>Женский</option>
    <?php
    endif;
endif;

if (isset($_POST['countOfExchangeItemToAccount']) && !isset($_POST['exchange'])) {
    require_once "core/application/controllers/cexchange.php";
    exchangeMoney_Controller::getInstance()->showCountOfExchange();
}

if (isset($_POST['countOfExchangeItemToAccount']) && $_POST['exchange']) {
    require_once "core/application/controllers/cexchange.php";
    exchangeMoney_Controller::getInstance()->exchangeToMoney();
}

if (isset($_POST['open_stigma'])) {
    require_once "core/application/controllers/cstigma.php";
    stigma_Controller::getInstance()->open_stigma();
}

if (isset($_POST['changeGender'])) {
    require_once "core/application/controllers/cchangegender.php";
    changeGender_Controller::getInstance()->changeGender();
}

if (isset($_POST['changeLogin'])) {
    require_once "core/application/controllers/cchangelogin.php";
    changeLogin_Controller::getInstance()->changeLogin();
}

if (isset($_POST['change'])) {
    require_once "core/application/controllers/cchangepassword.php";
    changePassword_Controller::getInstance()->change_password();
}

if (isset($_POST['setIpRestrict'])) {
    require_once "core/application/controllers/cipforce.php";
    ipProtect_Controller::getInstance()->setProtectIpAddress();
}

if (isset($_POST['deleteIpProtect'])) {
    require_once "core/application/controllers/cipforce.php";
    ipProtect_Controller::getInstance()->setProtectIpAddressToNull();
}

if (isset($_POST['act_premium'])) {
    require_once "core/application/controllers/cactivatepremium.php";
    activatePremium_Controller::getInstance()->setPremium();
}

if (isset($_POST['addToFriend'])) {
    require_once "core/application/controllers/crequests.php";
    requests_Controller::getInstance()->insertNewRecord();
}

if (isset($_POST['setParams'])) {
    require_once "core/application/controllers/csetparams.php";
    setParams_Controller::getInstance()->setParams();
}

if (isset($_POST['setSecret'])) {
    require_once "core/application/controllers/csetsecret.php";
    secretWord_Controller::getInstance()->setNewSecretWord();
}
?>